﻿<UserControl x:Class="WeatherReport.WindDirectionDisplay"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:tc="clr-namespace:WeatherReport.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <tc:IEnumerableOfPointsToPointCollectionConverter x:Key="IEnumerableOfPointsToPointCollection" />
        <tc:HsvColorToColorConverter x:Key="HsvColorToColor" />
    </UserControl.Resources>
    
    <Viewbox Stretch="Fill"
             HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Canvas Width="100" Height="100">
            <Polygon Points="{Binding Path=ArrowLeftWingPoints, Mode=OneWay, Converter={StaticResource IEnumerableOfPointsToPointCollection}}">
                <Polygon.Fill>
                    <SolidColorBrush Color="{Binding Path=ArrowLeftWingColor, Mode=OneWay, Converter={StaticResource HsvColorToColor}}" />
                </Polygon.Fill>
            </Polygon>
            <Polygon Points="{Binding Path=ArrowRightWingPoints, Mode=OneWay, Converter={StaticResource IEnumerableOfPointsToPointCollection}}">
                <Polygon.Fill>
                    <SolidColorBrush Color="{Binding Path=ArrowRightWingColor, Mode=OneWay, Converter={StaticResource HsvColorToColor}}" />
                </Polygon.Fill>
            </Polygon>
        </Canvas>
    </Viewbox>
</UserControl>
